//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Spreadsheet.Extensibility;

namespace OpenLS.Spreadsheet.Expressions
{
    class TextContext
    {
        public TextContext(EvaluationContext e)
        {
            _evaluationContext = e;
        }
        private readonly EvaluationContext _evaluationContext;
        public EvaluationContext EvaluationContext
        {
            get { return _evaluationContext; }
        }
	
        public TextContext(EvaluationContext e, IFunctionLocalizer loc)
            : this (e)
        {
            localizer = loc;
        }

        readonly IFunctionLocalizer localizer;
        public string GetName(string name)
        {
            if (localizer != null)
                return localizer.GetLocalName(name);
            return name;
        }
        public char FormulaArgumentSeparator
        {
            get
            {
                if (localizer == null)
                    return ',';
                return FormulaHelper.FormulaArgumentSeparatorLocalized;
            }
        }
    }
}
